<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			let num1 = prompt("请输入第一个数字：");
			let num2 = prompt("请输入第二个数字：");
			let operator = prompt("请输入运算符（+、-、*、/）：");
			
			num1 = parseFloat(num1);
			num2 = parseFloat(num2);
			
			switch (operator) {
			  case "+":
			    console.log(`结果是：${num1 + num2}`);
			    break;
			  case "-":
			    console.log(`结果是：${num1 - num2}`);
			    break;
			  case "*":
			    console.log(`结果是：${num1 * num2}`);
			    break;
			  case "/":
			    if (num2 !== 0) {
			      console.log(`结果是：${num1 / num2}`);
			    } else {
			      console.log("除数不能为零！");
			    }
			    break;
			  default:
			    console.log("无效的运算符，请输入+、-、*、/之一。");
			}
		</script>
	</body>
</html>